package com.dvdfe8.crochet.modelo.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

@Entity
@Table(name="LANA")
public class Lana implements Serializable{

    @Id
    @Column(name="LANA_ID")
    @GeneratedValue
    private int id;
    
    @Column(name="MARCA")
    private String marca;
    
    @Column(name="REFERENCIA")
    private String referencia;
    
    @Column(name="COLOR")  
    private String color;
    
    @Column(name="IMAGEN")
    private String imagen;
    
    @ManyToMany(fetch = FetchType.EAGER, mappedBy="lanas")
    /*@JoinTable(
            name="LANA_AMIGURUMI",
            joinColumns={@JoinColumn(name="AMIGURUMI_ID")},
            inverseJoinColumns={@JoinColumn(name="LANA_ID")}
    )*/
    private Collection<Amigurumi> amigurumis = new ArrayList<Amigurumi>();   
    
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getMarca() {
        return marca;
    }

    public void setMarca(String marca) {
        this.marca = marca;
    }

    public String getReferencia() {
        return referencia;
    }

    public void setReferencia(String referencia) {
        this.referencia = referencia;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getImagen() {
        return imagen;
    }

    public void setImagen(String imagen) {
        this.imagen = imagen;
    }

    public Collection<Amigurumi> getAmigurumis() {
        return amigurumis;
    }

    public void setAmigurumis(ArrayList<Amigurumi> amigurumis) {
        this.amigurumis = amigurumis;
    }

}
